'use strict';

function login() {
    let username = $('[name=username]').val();
    let password = $('[name=password]').val();

    let obj = {
        username,
        password
    }

    $.post(`${url}/login`, obj, res => {
        console.log(res);
        if(res.code===1000){
            window.location.href='./index.html';
        }else{
            alert(res.msg);
        }
    })
}